package edu.study.user.api;

import edu.study.api.common.dto.BaseRespDto;
import edu.study.api.common.dto.RespDto;
import edu.study.user.api.dto.UserDetailDto;
import edu.study.user.api.dto.UserDto;
import edu.study.user.api.req.user.AddUserReq;
import edu.study.user.api.req.user.LoginReq;
import edu.study.user.api.req.user.ModifyPasswordReq;
import edu.study.user.api.req.user.QueryUserListReq;
import edu.study.user.api.req.user.QueryUserReq;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import java.util.List;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 1.要么没有入参，要么封装成req对象
 * 2.返回类型：BaseRespDto RespDto<T> PageRespDto<T> 三种
 */
@RequestMapping("/api/user/userApi")
@Api(value = "/api/user/userApi", tags = { "用户相关接口-1.0" })
public interface UserApi {

    @ApiOperation(value = "新增用户")
    @RequestMapping(value = "addUser", method = {RequestMethod.POST})
    BaseRespDto addUser(@RequestBody AddUserReq req);
    
    @ApiOperation(value = "登录")
    @RequestMapping(value = "login", method = {RequestMethod.POST})
    RespDto<UserDetailDto> login(@RequestBody LoginReq req);
        
    @ApiOperation(value = "修改密码")
    @RequestMapping(value = "modifyPassword", method = {RequestMethod.POST})
    BaseRespDto modifyPassword(@RequestBody ModifyPasswordReq req);
    
    @ApiOperation(value = "查询用户")
    @RequestMapping(value = "queryUser", method = {RequestMethod.POST})
    RespDto<UserDto> queryUser(@RequestBody QueryUserReq req);
    
    @ApiOperation(value = "查询用户列表")
    @RequestMapping(value = "queryUserList", method = {RequestMethod.POST})
    RespDto<List<UserDto>> queryUserList(@RequestBody QueryUserListReq req);
}
